<?php

declare(strict_types=1);
namespace App\Controller;


use Hyperf\Contract\OnReceiveInterface;
use Swoole\Coroutine\Server\Connection;
use Swoole\Server as SwooleServer;

class TcpServerController implements OnReceiveInterface
{

    /**
     * @param Connection|SwooleServer $server
     */
    public function onReceive($server, int $fd, int $fromId, string $data): void
    {
        // TODO: Implement onReceive() method.
        $server->send($fd, 'recv:' . $data);
    }
}